package com.danbay.framework.db.datasource;

import lombok.Data;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author SJG
 *         2017/12/13.
 */
@ConfigurationProperties(prefix = "spring.datasource")
@Data
public class DynamicDataSourceProperties extends DataSourceProperties {

    private DruidConfig druid;


    @Data
    public static class DruidConfig {

        private int maxActive;
        private int initialSize;
        private int minIdle;
        private int maxWait;
        private int timeBetweenEvictionRunsMillis;
        private int minEvictableIdleTimeMillis;
        private boolean testWhileIdle;
        private boolean testOnBorrow;
        private boolean testOnReturn;
        private boolean poolPreparedStatements;
        private String filters;
        private DruidDataSourceActives actives;
    }

    @Data
    public static class DruidDataSourceActives{
        private DataSourceProperties one;
        private DataSourceProperties two;
        private DataSourceProperties three;
        private DataSourceProperties four;
        private DataSourceProperties five;
        private DataSourceProperties six;
        private DataSourceProperties seven;
        private DataSourceProperties eight;
        private DataSourceProperties nine;
        private DataSourceProperties ten;
    }
}
